package b59;

import java.io.BufferedReader;
        import java.io.IOException;
        import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String s = bf.readLine();
        String[] split = s.split(",");
        int[] height = new int[split.length];
        for (int i = 0; i < split.length; i++) {
            height[i] = Integer.parseInt(split[i]);
        }
        float v = maxArea(height);
        System.out.println(v);
    }
    public static float maxArea(int[] height){
        float res = 0;
        for (int i = 0; i < height.length; i++) {
            if(height[i] == 0){
                continue;
            }
            for (int j = i+1; j < height.length; j++) {
                if(height[j] == 0){
                    continue;
                }
                float temp = (float) (0.5*(height[i]+height[j])*(j-i));
                res = Math.max(temp,res);
            }
        }
        return res;
    }
}
